/**
 * 系统管理相关api
 */
import service from '..'

/**
 * 用户管理
 */
export function getUsers(queryParams: any) {
  return service({
    method: 'get',
    url: '/users',
    params: queryParams,
  })
}

export function removeUser(id: number) {
  return service({
    method: 'delete',
    url: `/users/${id}`,
  })
}

export function addUser(userForm: any) {
  return service({
    method: 'post',
    url: `/users`,
    data: userForm,
  })
}

export function updateUser(id: number, userForm: any) {
  return service({
    method: 'put',
    url: `/users/${id}`,
    data: userForm,
  })
}

export function getUser(id: number) {
  return service({
    method: 'get',
    url: `/users/${id}`,
  })
}

export function getRoles(queryParams: any) {
  return service({
    method: 'get',
    url: '/roles',
    params: queryParams,
  })
}

export function getDepartments(queryParams: any) {
  return service({
    method: 'get',
    url: '/depts',
    params: queryParams,
  })
}
